-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSDK-7843: Do not remove resources when a remote has a transient error. #4268
Conversation
@@ -131,7 +131,7 @@ func isClosedPipeError(err error) bool { | |||
} | |||
|
|||
func (rc *RobotClient) notConnectedToRemoteError() error { | |||
return errors.Errorf("not connected to remote robot at %s", rc.address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This usage adds a stack trace to the error. I found them to be an eyesore and not at all helpful.
robot/client/client.go
Outdated
@@ -346,7 +346,10 @@ func (rc *RobotClient) connectWithLock(ctx context.Context) error { | |||
if err := rc.conn.Close(); err != nil { | |||
return err | |||
} | |||
conn, err := grpc.Dial(ctx, rc.address, rc.logger, rc.dialOptions...) | |||
|
|||
cancelCtx, stop := context.WithTimeout(ctx, time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, need to revert this and see if there's a better option for speeding up the test.
robot/client/client.go
Outdated
@@ -406,6 +409,7 @@ func (rc *RobotClient) checkConnection(ctx context.Context, checkEvery, reconnec | |||
return | |||
} | |||
} | |||
rc.logger.Info("Waiting to recheck. WaitTime:", waitTime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting
@@ -709,9 +713,8 @@ func (rc *RobotClient) PackageManager() packages.Manager { | |||
return nil | |||
} | |||
|
|||
// ResourceNames returns a list of all known resource names connected to this machine. | |||
// | |||
// resource_names := machine.ResourceNames() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know if this served a purpose -- happy to reintroduce if there's some magic documentation thing going on here
for _, resName := range newResources { | ||
remoteResName := resName | ||
res, err := rr.ResourceByName(remoteResName) // this returns a remote known OR foreign resource client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing changed here. Just code movement. What's important is this is now below oldline 215/newline 208. I hope the comment I added to the new code outlines the significance.
There is no test coverage of the error case here.
this change is incorporated into #4273, so I'm removing myself as a reviewer |
ported from PR: viamrobotics#4268
No description provided.